package test.org.dei;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Properties;

import org.dei.perla.utils.PerlaEnv;
import org.dei.perla.utils.PerlaRuntime;

public class DefaultConfGenerator {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		PerlaEnv.init();
		Properties properties = new Properties();
		properties.setProperty(PerlaRuntime.PERLA_LAST_QUERY_EXECUTED, "SET acquisitionType=0, command=0, rs1=0x2117, rs2=0x3751, rs3=0x0, rs4=0x80, gx=68 , gy=69, gz=30, thupX=0xf, thupY=0xf, thupZ=0xf, ltaInterSample=0x100, thdwY=0x3f, thdwZ=0x3f, tapsx = NEW(CONSTANTVECTORINTEGER, \"0xFE02, 0xFE12, 0xFE42, 0xFE92, 0xFF02, 0xFF91, 0x3C, 0x101, 0x1DB, 0x2C2, 0x3B3, 0x4A4, 0x58F, 0x66D, 0x736, 0x7E5, 0x873, 0x8DC, 0x91C, 0x932, 0x91C, 0x8DC, 0x873, 0x7E5, 0x736, 0x66D, 0x58F, 0x4A4, 0x3B3, 0x2C2, 0x1DB, 0x101, 0x3C, 0xFF91, 0xFF02, 0xFE92, 0xFE42, 0xFE12, 0xFE02\"), tapsz = NEW(CONSTANTVECTORINTEGER, \"0x3BE, 0xFF5A, 0xFB8E, 0x26E, 0x50C, 0xFAB6, 0xFA81, 0xB1E, 0x5C9, 0xDB07, 0x34ED, 0xDB07, 0x5C9, 0xB1E, 0xFA81, 0xFAB6, 0x50C, 0x26E, 0xFB8E, 0xFF5A\"), tapsy = NEW(CONSTANTVECTORINTEGER, \"0xFDB3, 0x12C, 0x342, 0x247, 0x0, 0xFF50, 0x71, 0x9C, 0xFDDD, 0xFA96, 0xFBBD, 0x2D1, 0xA61, 0xA34, 0x0, 0xF377, 0xF03A, 0xFAA1, 0xA84, 0x120E, 0xA84, 0xFAA1, 0xF03A, 0xF377, 0x0, 0xA34, 0xA61, 0x2D1, 0xFBBD, 0xFA96, 0xFDDD, 0x9C, 0x71, 0xFF50, 0x0, 0x247, 0x342, 0x12C, 0xFDB3\") ON 1");
		properties.setProperty("PERLA_DB", "jdbc:mysql://localhost/perla?");
		properties.setProperty("PERLA_DB_AUTH", "user=perla&password=perla");
		
		String path = PerlaEnv.getPerlaHome();
		String filename = PerlaEnv.getPerlaRcName();
		try {
			properties.storeToXML(new FileOutputStream(new File(path +"/"+ filename)), null);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
